package cn.javass.dp.iterator.mydemo1;

public class ConcreteAggregate extends Aggregate {

    private Object[] ss = null;

    public ConcreteAggregate(Object[] ss) {
        this.ss = ss;
    }

    public int size() {
        if (ss !=null) {
            return ss.length;
        }
        return 0;
    };

    public Object get(int index) {
        if (ss != null && ss.length >0) {
            return ss[index];
        }
        return null;
    }


    @Override
    public Iterator createIterator() {
        return new ConcreteIterator(this);
    }
}
